home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Concept 6
/
CD Concept 06.iso
/
mac
/
UTILITAIRE
/
Little Smalltalk v3.1.4
/
C Source
/
Sources
/
tty.c
< prev
next >
Wrap
Text File
|
1994-05-28
|
2KB
|
77 lines
/*
Little Smalltalk, version 3
Written by Tim Budd, January 1989
tty interface routines
this is used by those systems that have a bare tty interface
systems using another interface, such as the stdwin interface
will replace this file with another.
*/
# include <stdio.h>
# include "env.h"
# include "memory.h"
#include "tty.proto.h"
#include "tty.proto.h"
#include "tty.proto.h"
extern boolean parseok;
/* report a fatal system error */
noreturn sysError(char *s1, char *s2)
{
ignore fprintf(stderr,"%s\n%s\n", s1, s2);
ignore abort();
}
/* report a nonfatal system error */
noreturn sysWarn(char *s1, char *s2)
{
ignore fprintf(stderr,"%s\n%s\n", s1, s2);
}
compilWarn(char *selector, char *str1, char *str2)
{
ignore fprintf(stderr,"compiler warning: Method %s : %s %s\n",
selector, str1, str2);
}
compilError(char *selector, char *str1, char *str2)
{
ignore fprintf(stderr,"compiler error: Method %s : %s %s\n",
selector, str1, str2);
parseok = false;
}
noreturn dspMethod(char *cp, char *mp)
{
/*ignore fprintf(stderr,"%s %s\n", cp, mp);*/
}
givepause(void)
{ char buffer[80];
ignore fprintf(stderr,"push return to continue\n");
ignore gets(buffer);
}
object sysPrimitive(int number, object *arguments)
{ object returnedObject;
/* someday there will be more here */
switch(number - 150) {
case 0: /* do a system() call */
returnedObject = newInteger(system(
charPtr(arguments[0])));
break;
default:
sysError("unknown primitive","sysPrimitive");
}
return(returnedObject);
}